package com.lzhsite.technology.designPattern.factory.simpleFactory;

public class CarSimpleFactory {
	/**
	 * 
	 * 方法说明：根据传入的汽车类型，返回不同的对象
	 * 
	 * @param carType
	 * @return
	 * @return ICar
	 */
	public static ICar createCar(CarType carType) {
		ICar obj = null;
		if (carType == CarType.TOP_CAR) {
 
			obj = new TopCar();
		} else if (carType == CarType.MID_CAR) {
 
			obj = new MidCar();
		} else if (carType == CarType.LOW_CAR) {
 
			obj = new LowCar();
		}
		return obj;
	}
}
